package com.namo.cchapi.consumer;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;

/**
 * @author WangXin
 * @date 2021/4/11 10:08
 */
@FeignClient("cch-file")
public interface FileConsumer {
    /**
     * 上传图片
     * @param multipartFile
     * @return
     */
    @RequestMapping(method = RequestMethod.POST,value = "/pic/upload",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    String upPic(@RequestPart(value = "file") MultipartFile multipartFile);


    /**
     *
     * 删除图片
     * @param objectName
     * @return
     */
    @RequestMapping(method = RequestMethod.POST,value = "/pic/delete")
    String deletePic(@RequestParam("object_name") String objectName);
}
